API: remove gdk_draw_glyphs() and gdk_draw_glyphs_transformed()
authorBenjamin Otte <otte@redhat.com>
Wed, 14 Jul 2010 14:03:51 +0000 (16:03 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 10 Aug 2010 19:02:27 +0000 (21:02 +0200)
docs/reference/gdk/gdk3-sections.txt
docs/reference/gdk/tmpl/drawing.sgml
docs/reference/gdk/tmpl/pango_interaction.sgml
gdk/gdk.symbols
gdk/gdkdraw.c
gdk/gdkdrawable.h
gdk/gdkpixmap.c
gdk/gdkwindow.c

index e9bd33ee9d778235aceeb08f5a9d09befc9838ca..5963faeab1de0b4736191dbdc8782b378271dc2f 100644 (file)
@@ -342,8 +342,6 @@ gdk_draw_segments
 GdkSegment
 gdk_draw_rectangle
 gdk_draw_polygon
-gdk_draw_glyphs
-gdk_draw_glyphs_transformed
 gdk_draw_layout_line
 gdk_draw_layout_line_with_colors
 gdk_draw_layout
index 3b7b4be55b3976620b076d117e08c096971e8f7f..46f63f56dde048667cfd11d54a2703257afcc1b0 100644 (file)
@@ -219,33 +219,6 @@ function.
 @n_points: 
 
 
-<!-- ##### FUNCTION gdk_draw_glyphs ##### -->
-<para>
-
-</para>
-
-@drawable: 
-@gc: 
-@font: 
-@x: 
-@y: 
-@glyphs: 
-
-
-<!-- ##### FUNCTION gdk_draw_glyphs_transformed ##### -->
-<para>
-
-</para>
-
-@drawable: 
-@gc: 
-@matrix: 
-@font: 
-@x: 
-@y: 
-@glyphs: 
-
-
 <!-- ##### FUNCTION gdk_draw_layout_line ##### -->
 <para>
 
index b9556a9b7f94a0ec34c59d5852e620fb515386cb..82e4c3085a6e62bd01f99443e106dabeddf7c0fc 100644 (file)
@@ -25,11 +25,10 @@ linkend="PANGO-SCALE-CAPS">PANGO_SCALE</link> or the PANGO_PIXELS() macro.)
 </para>
 <para>
 Rendering a Pango layout is done most simply with gdk_draw_layout();
-you can also draw pieces of the layout with gdk_draw_layout() or
-gdk_draw_glyphs(). #GdkPangoRenderer is a subclass of #PangoRenderer
-that is used internally to implement these functions. Using it
-directly or subclassing it can be useful in some cases. See the
-#GdkPangoRenderer documentation for details.
+you can also draw pieces of the layout with gdk_draw_layout().
+#GdkPangoRenderer is a subclass of #PangoRenderer that is used internally
+to implement these functions. Using it directly or subclassing it can be
+useful in some cases. See the #GdkPangoRenderer documentation for details.
 </para>
 <example id="rotated-example">
 <title>Using #GdkPangoRenderer to draw transformed text</title>
index be739e71b3d0332f47a8de5a504a61cd084930df..f62bf7f1515bf0f995042e4aab39841b01415958 100644 (file)
@@ -550,8 +550,6 @@ gdk_drawable_get_visible_region
 gdk_drawable_get_visual
 gdk_drawable_set_colormap
 gdk_draw_drawable
-gdk_draw_glyphs
-gdk_draw_glyphs_transformed
 gdk_draw_line
 gdk_draw_lines
 gdk_draw_point
index 933cc94527d98f276cdcfc6974740870c6ca6e64..0a8532c54dbae3b6494f49ca83e567dfb86e36d5 100644 (file)
@@ -530,113 +530,6 @@ gdk_draw_lines (GdkDrawable    *drawable,
                                                  (GdkPoint *) points, n_points);
 }
 
-static void
-real_draw_glyphs (GdkDrawable       *drawable,
-                 GdkGC             *gc,
-                 const PangoMatrix *matrix,
-                 PangoFont         *font,
-                 gdouble            x,
-                 gdouble            y,
-                 PangoGlyphString  *glyphs)
-{
-  cairo_t *cr;
-
-  cr = gdk_cairo_create (drawable);
-  _gdk_gc_update_context (gc, cr, NULL, NULL, TRUE, drawable);
-
-  if (matrix)
-    {
-      cairo_matrix_t cairo_matrix;
-
-      cairo_matrix.xx = matrix->xx;
-      cairo_matrix.yx = matrix->yx;
-      cairo_matrix.xy = matrix->xy;
-      cairo_matrix.yy = matrix->yy;
-      cairo_matrix.x0 = matrix->x0;
-      cairo_matrix.y0 = matrix->y0;
-      
-      cairo_set_matrix (cr, &cairo_matrix);
-    }
-
-  cairo_move_to (cr, x, y);
-  pango_cairo_show_glyph_string (cr, font, glyphs);
-
-  cairo_destroy (cr);
-}
-
-/**
- * gdk_draw_glyphs:
- * @drawable: a #GdkDrawable
- * @gc: a #GdkGC
- * @font: font to be used
- * @x: X coordinate of baseline origin
- * @y: Y coordinate of baseline origin
- * @glyphs: the glyph string to draw
- *
- * This is a low-level function; 99% of text rendering should be done
- * using gdk_draw_layout() instead.
- *
- * A glyph is a single image in a font. This function draws a sequence of
- * glyphs.  To obtain a sequence of glyphs you have to understand a
- * lot about internationalized text handling, which you don't want to
- * understand; thus, use gdk_draw_layout() instead of this function,
- * gdk_draw_layout() handles the details.
- * 
- **/
-void
-gdk_draw_glyphs (GdkDrawable      *drawable,
-                GdkGC            *gc,
-                PangoFont        *font,
-                gint              x,
-                gint              y,
-                PangoGlyphString *glyphs)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (GDK_IS_GC (gc));
-  
-  real_draw_glyphs (drawable, gc, NULL, font,
-                   x, y, glyphs);
-}
-
-/**
- * gdk_draw_glyphs_transformed:
- * @drawable: a #GdkDrawable
- * @gc: a #GdkGC
- * @matrix: (allow-none): a #PangoMatrix, or %NULL to use an identity transformation
- * @font: the font in which to draw the string
- * @x:       the x position of the start of the string (in Pango
- *           units in user space coordinates)
- * @y:       the y position of the baseline (in Pango units
- *           in user space coordinates)
- * @glyphs:  the glyph string to draw
- * 
- * Renders a #PangoGlyphString onto a drawable, possibly
- * transforming the layed-out coordinates through a transformation
- * matrix. Note that the transformation matrix for @font is not
- * changed, so to produce correct rendering results, the @font
- * must have been loaded using a #PangoContext with an identical
- * transformation matrix to that passed in to this function.
- *
- * See also gdk_draw_glyphs(), gdk_draw_layout().
- *
- * Since: 2.6
- **/
-void
-gdk_draw_glyphs_transformed (GdkDrawable       *drawable,
-                            GdkGC             *gc,
-                            const PangoMatrix *matrix,
-                            PangoFont         *font,
-                            gint               x,
-                            gint               y,
-                            PangoGlyphString  *glyphs)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (GDK_IS_GC (gc));
-
-  real_draw_glyphs (drawable, gc, matrix, font,
-                   x / PANGO_SCALE, y / PANGO_SCALE, glyphs);
-}
-
 static GdkDrawable *
 gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable,
                                           gint         x,
index 5a94f848423f8163102702d2bac47647b23473d4..93d61c3e62598b3dc193d73f48ef0c39450d4209 100644 (file)
@@ -94,13 +94,6 @@ struct _GdkDrawableClass
                          GdkPoint     *points,
                          gint          npoints);
 
-  void (*draw_glyphs)    (GdkDrawable      *drawable,
-                         GdkGC            *gc,
-                         PangoFont        *font,
-                         gint              x,
-                         gint              y,
-                         PangoGlyphString *glyphs);
-
   gint (*get_depth)      (GdkDrawable  *drawable);
   void (*get_size)       (GdkDrawable  *drawable,
                           gint         *width,
@@ -124,14 +117,6 @@ struct _GdkDrawableClass
                                           gint        *composite_x_offset,
                                           gint        *composite_y_offset);
 
-  void (*draw_glyphs_transformed) (GdkDrawable      *drawable,
-                                  GdkGC            *gc,
-                                  PangoMatrix      *matrix,
-                                  PangoFont        *font,
-                                  gint              x,
-                                  gint              y,
-                                  PangoGlyphString *glyphs);
-
   cairo_surface_t *(*ref_cairo_surface) (GdkDrawable *drawable);
 
   GdkDrawable *(*get_source_drawable) (GdkDrawable *drawable);
@@ -226,12 +211,6 @@ void gdk_draw_lines     (GdkDrawable      *drawable,
                         const GdkPoint   *points,
                         gint              n_points);
 
-void gdk_draw_glyphs      (GdkDrawable      *drawable,
-                          GdkGC            *gc,
-                          PangoFont        *font,
-                          gint              x,
-                          gint              y,
-                          PangoGlyphString *glyphs);
 void gdk_draw_layout_line (GdkDrawable      *drawable,
                           GdkGC            *gc,
                           gint              x,
@@ -258,14 +237,6 @@ void gdk_draw_layout_with_colors      (GdkDrawable     *drawable,
                                        const GdkColor  *foreground,
                                        const GdkColor  *background);
 
-void gdk_draw_glyphs_transformed (GdkDrawable        *drawable,
-                                 GdkGC              *gc,
-                                 const PangoMatrix  *matrix,
-                                 PangoFont          *font,
-                                 gint                x,
-                                 gint                y,
-                                 PangoGlyphString   *glyphs);
-
 cairo_region_t *gdk_drawable_get_clip_region    (GdkDrawable *drawable);
 cairo_region_t *gdk_drawable_get_visible_region (GdkDrawable *drawable);
 
index dd4eb1266ce6b5e28fb56599f3665ddbcdac8919..6915cd7ee2917b68a580dd9409f3fe210eb8e040 100644 (file)
@@ -69,20 +69,6 @@ static void   gdk_pixmap_draw_lines     (GdkDrawable     *drawable,
                                         GdkPoint        *points,
                                         gint             npoints);
 
-static void gdk_pixmap_draw_glyphs             (GdkDrawable      *drawable,
-                                               GdkGC            *gc,
-                                               PangoFont        *font,
-                                               gint              x,
-                                               gint              y,
-                                               PangoGlyphString *glyphs);
-static void gdk_pixmap_draw_glyphs_transformed (GdkDrawable      *drawable,
-                                               GdkGC            *gc,
-                                               PangoMatrix      *matrix,
-                                               PangoFont        *font,
-                                               gint              x,
-                                               gint              y,
-                                               PangoGlyphString *glyphs);
-
 static void   gdk_pixmap_real_get_size  (GdkDrawable     *drawable,
                                          gint            *width,
                                          gint            *height);
@@ -146,8 +132,6 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
   drawable_class->draw_points = gdk_pixmap_draw_points;
   drawable_class->draw_segments = gdk_pixmap_draw_segments;
   drawable_class->draw_lines = gdk_pixmap_draw_lines;
-  drawable_class->draw_glyphs = gdk_pixmap_draw_glyphs;
-  drawable_class->draw_glyphs_transformed = gdk_pixmap_draw_glyphs_transformed;
   drawable_class->get_depth = gdk_pixmap_real_get_depth;
   drawable_class->get_screen = gdk_pixmap_real_get_screen;
   drawable_class->get_size = gdk_pixmap_real_get_size;
@@ -315,35 +299,6 @@ gdk_pixmap_draw_lines (GdkDrawable *drawable,
   gdk_draw_lines (private->impl, gc, points, npoints);
 }
 
-static void
-gdk_pixmap_draw_glyphs (GdkDrawable      *drawable,
-                        GdkGC            *gc,
-                        PangoFont        *font,
-                        gint              x,
-                        gint              y,
-                        PangoGlyphString *glyphs)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)drawable;
-
-  _gdk_gc_remove_drawable_clip (gc);  
-  gdk_draw_glyphs (private->impl, gc, font, x, y, glyphs);
-}
-
-static void
-gdk_pixmap_draw_glyphs_transformed (GdkDrawable      *drawable,
-                                   GdkGC            *gc,
-                                   PangoMatrix      *matrix,
-                                   PangoFont        *font,
-                                   gint              x,
-                                   gint              y,
-                                   PangoGlyphString *glyphs)
-{
-  GdkPixmapObject *private = (GdkPixmapObject *)drawable;
-
-  _gdk_gc_remove_drawable_clip (gc);  
-  gdk_draw_glyphs_transformed (private->impl, gc, matrix, font, x, y, glyphs);
-}
-
 static void
 gdk_pixmap_real_get_size (GdkDrawable *drawable,
                           gint *width,
index e63619342925088756d6dc059c8c6eb779cad490..5be5f91c09b6964d1c387804f84b5f2f31632657 100644 (file)
@@ -264,20 +264,6 @@ static void   gdk_window_draw_lines     (GdkDrawable     *drawable,
                                         GdkPoint        *points,
                                         gint             npoints);
 
-static void gdk_window_draw_glyphs             (GdkDrawable      *drawable,
-                                               GdkGC            *gc,
-                                               PangoFont        *font,
-                                               gint              x,
-                                               gint              y,
-                                               PangoGlyphString *glyphs);
-static void gdk_window_draw_glyphs_transformed (GdkDrawable      *drawable,
-                                               GdkGC            *gc,
-                                               PangoMatrix      *matrix,
-                                               PangoFont        *font,
-                                               gint              x,
-                                               gint              y,
-                                               PangoGlyphString *glyphs);
-
 static cairo_surface_t *gdk_window_ref_cairo_surface (GdkDrawable *drawable);
 static cairo_surface_t *gdk_window_create_cairo_surface (GdkDrawable *drawable,
                                                         int width,
@@ -461,8 +447,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
   drawable_class->draw_points = gdk_window_draw_points;
   drawable_class->draw_segments = gdk_window_draw_segments;
   drawable_class->draw_lines = gdk_window_draw_lines;
-  drawable_class->draw_glyphs = gdk_window_draw_glyphs;
-  drawable_class->draw_glyphs_transformed = gdk_window_draw_glyphs_transformed;
   drawable_class->get_depth = gdk_window_real_get_depth;
   drawable_class->get_screen = gdk_window_real_get_screen;
   drawable_class->get_size = gdk_window_real_get_size;
@@ -4369,69 +4353,6 @@ gdk_window_draw_lines (GdkDrawable *drawable,
   END_DRAW;
 }
 
-static void
-gdk_window_draw_glyphs (GdkDrawable      *drawable,
-                       GdkGC            *gc,
-                       PangoFont        *font,
-                       gint              x,
-                       gint              y,
-                       PangoGlyphString *glyphs)
-{
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  BEGIN_DRAW;
-  gdk_draw_glyphs (impl, gc, font,
-                  x - x_offset, y - y_offset, glyphs);
-  END_DRAW;
-}
-
-static void
-gdk_window_draw_glyphs_transformed (GdkDrawable      *drawable,
-                                   GdkGC            *gc,
-                                   PangoMatrix      *matrix,
-                                   PangoFont        *font,
-                                   gint              x,
-                                   gint              y,
-                                   PangoGlyphString *glyphs)
-{
-  PangoMatrix tmp_matrix;
-
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  BEGIN_DRAW;
-
-  if (x_offset != 0 || y_offset != 0)
-    {
-      if (matrix)
-       {
-         tmp_matrix = *matrix;
-         tmp_matrix.x0 -= x_offset;
-         tmp_matrix.y0 -= y_offset;
-         matrix = &tmp_matrix;
-       }
-      else if (GDK_PANGO_UNITS_OVERFLOWS (x_offset, y_offset))
-       {
-         PangoMatrix identity = PANGO_MATRIX_INIT;
-
-         tmp_matrix = identity;
-         tmp_matrix.x0 -= x_offset;
-         tmp_matrix.y0 -= y_offset;
-         matrix = &tmp_matrix;
-       }
-      else
-       {
-         x -= x_offset * PANGO_SCALE;
-         y -= y_offset * PANGO_SCALE;
-       }
-    }
-
-  gdk_draw_glyphs_transformed (impl, gc, matrix, font, x, y, glyphs);
-
-  END_DRAW;
-}
-
 static cairo_t *
 setup_backing_rect (GdkWindow *window, GdkWindowPaint *paint, int x_offset_cairo, int y_offset_cairo)
 {